package com.mitake.task;

import java.util.ArrayList;

import com.mitake.parse.Stock;
import com.mitake.utils.Util;

public class CompareProcess
{
	public static ArrayList<Stock[]> store = new ArrayList<Stock[]>();
	
	public static void compare(Stock[] stockList)
	{
		/**
		 * 再来比对每个栏位,并将一样股票一起比
		 */
		for(int i = 1, len = stockList.length - 1 ; i < len ; i++)
		{
			if(Util.hasDifference(stockList[i].status, stockList[i + 1].status))
			{
				stockList[0].status = "@";
			}
			
			if(Util.hasDifference(stockList[i].datetime, stockList[i + 1].datetime))
			{
				stockList[0].datetime = "@";
			}
			
			if(Util.hasDifference(stockList[i].market, stockList[i + 1].market))
			{
				stockList[0].market = "@";
			}
			
			if(Util.hasDifference(stockList[i].subtype, stockList[i + 1].subtype))
			{
				stockList[0].subtype = "@";
			}
			
			if(Util.hasDifference(stockList[i].lastPrice, stockList[i + 1].lastPrice))
			{
				stockList[0].lastPrice = "@";
			}
			
			if(Util.hasDifference(stockList[i].highPrice, stockList[i + 1].highPrice))
			{
				stockList[0].highPrice = "@";
			}
			
			if(Util.hasDifference(stockList[i].lowPrice, stockList[i + 1].lowPrice))
			{
				stockList[0].lowPrice = "@";
			}

			if(Util.hasDifference(stockList[i].openPrice, stockList[i + 1].openPrice))
			{
				stockList[0].openPrice = "@";
			}
			
			if(Util.hasDifference(stockList[i].preClosePrice, stockList[i + 1].preClosePrice))
			{
				stockList[0].preClosePrice = "@";
			}
			
			if(Util.hasDifference(stockList[i].changeRate, stockList[i + 1].changeRate))
			{
				stockList[0].changeRate = "@";
			}
			
			if(Util.hasDifference(stockList[i].volume, stockList[i + 1].volume))
			{
				stockList[0].volume = "@";
			}
			
			if(Util.hasDifference(stockList[i].nowVolume, stockList[i + 1].nowVolume))
			{
				stockList[0].nowVolume = "@";
			}
			
			if(Util.hasDifference(stockList[i].turnoverRate, stockList[i + 1].turnoverRate))
			{
				stockList[0].turnoverRate = "@";
			}

			if(Util.hasDifference(stockList[i].limitUP, stockList[i + 1].limitUP))
			{
				stockList[0].limitUP = "@";
			}
			
			if(Util.hasDifference(stockList[i].limitDown, stockList[i + 1].limitDown))
			{
				stockList[0].limitDown = "@";
			}
			
			if(Util.hasDifference(stockList[i].averageValue, stockList[i + 1].averageValue))
			{
				stockList[0].averageValue = "@";
			}
			
			if(Util.hasDifference(stockList[i].change, stockList[i + 1].change))
			{
				stockList[0].change = "@";
			}
			
			if(Util.hasDifference(stockList[i].amount, stockList[i + 1].amount))
			{
				stockList[0].amount = "@";
			}
			
			if(Util.hasDifference(stockList[i].volumeRatio, stockList[i + 1].volumeRatio))
			{
				stockList[0].volumeRatio = "@";
			}
			
			if(Util.hasDifference(stockList[i].buyPrice, stockList[i + 1].buyPrice))
			{
				stockList[0].buyPrice = "@";
			}
			
			if(Util.hasDifference(stockList[i].sellPrice, stockList[i + 1].sellPrice))
			{
				stockList[0].sellPrice = "@";
			}

			if(Util.hasDifference(stockList[i].buyVolume, stockList[i + 1].buyVolume))
			{
				stockList[0].buyVolume = "@";
			}
			
			if(Util.hasDifference(stockList[i].sellVolume, stockList[i + 1].sellVolume))
			{
				stockList[0].sellVolume = "@";
			}
			
			if(Util.hasDifference(stockList[i].totalValue, stockList[i + 1].totalValue))
			{
				stockList[0].totalValue = "@";
			}
			
			if(Util.hasDifference(stockList[i].flowValue, stockList[i + 1].flowValue))
			{
				stockList[0].flowValue = "@";
			}

			if(Util.hasDifference(stockList[i].netAsset, stockList[i + 1].netAsset))
			{
				stockList[0].netAsset = "@";
			}
			
			if(Util.hasDifference(stockList[i].pe, stockList[i + 1].pe))
			{
				stockList[0].pe = "@";
			}
			
			if(Util.hasDifference(stockList[i].roe, stockList[i + 1].roe))
			{
				stockList[0].roe = "@";
			}
			
			if(Util.hasDifference(stockList[i].capitalization, stockList[i + 1].capitalization))
			{
				stockList[0].capitalization = "@";
			}
			
			if(Util.hasDifference(stockList[i].circulatingShares, stockList[i + 1].circulatingShares))
			{
				stockList[0].circulatingShares = "@";
			}

			if(Util.hasDifference(stockList[i].buyPricesTmp, stockList[i + 1].buyPricesTmp))
			{
				stockList[0].buyPricesTmp = "@";
			}
			
			if(Util.hasDifference(stockList[i].sellPricesTmp, stockList[i + 1].sellPricesTmp))
			{
				stockList[0].sellPricesTmp = "@";
			}
			
			if(Util.hasDifference(stockList[i].buyVolumesTmp, stockList[i + 1].buyVolumesTmp))
			{
				stockList[0].buyVolumesTmp = "@";
			}
			
			if(Util.hasDifference(stockList[i].buySingleVolumesTmp, stockList[i + 1].buySingleVolumesTmp))
			{
				stockList[0].buySingleVolumesTmp = "@";
			}
			
			if(Util.hasDifference(stockList[i].sellVolumesTmp, stockList[i + 1].sellVolumesTmp))
			{
				stockList[0].sellVolumesTmp = "@";
			}
			
			if(Util.hasDifference(stockList[i].sellSingleVolumesTmp, stockList[i + 1].sellSingleVolumesTmp))
			{
				stockList[0].sellSingleVolumesTmp = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].amplitudeRate, stockList[i + 1].amplitudeRate))
			{
				stockList[0].amplitudeRate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].receipts, stockList[i + 1].receipts))
			{
				stockList[0].receipts = "@";
			}

		    if(Util.hasDifference(stockList[i].tradeTickTmp, stockList[i + 1].tradeTickTmp))
			{
				stockList[0].tradeTickTmp = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].upCount, stockList[i + 1].upCount))
			{
				stockList[0].upCount = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].sameCount, stockList[i + 1].sameCount))
			{
				stockList[0].sameCount = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].downCount, stockList[i + 1].downCount))
			{
				stockList[0].downCount = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].contractID, stockList[i + 1].contractID))
			{
				stockList[0].contractID = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].objectID, stockList[i + 1].objectID))
			{
				stockList[0].objectID = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].stockSymble, stockList[i + 1].stockSymble))
			{
				stockList[0].stockSymble = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].stockType, stockList[i + 1].stockType))
			{
				stockList[0].stockType = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].stockUnit, stockList[i + 1].stockUnit))
			{
				stockList[0].stockUnit = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].exePrice, stockList[i + 1].exePrice))
			{
				stockList[0].exePrice = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].startDate, stockList[i + 1].startDate))
			{
				stockList[0].startDate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].endDate, stockList[i + 1].endDate))
			{
				stockList[0].endDate = "@";
			}

		    if(Util.hasDifference(stockList[i].exeDate, stockList[i + 1].exeDate))
			{
				stockList[0].exeDate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].delDate, stockList[i + 1].delDate))
			{
				stockList[0].delDate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].expDate, stockList[i + 1].expDate))
			{
				stockList[0].expDate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].version, stockList[i + 1].version))
			{
				stockList[0].version = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].presetPrice, stockList[i + 1].presetPrice))
			{
				stockList[0].presetPrice = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].setPrice, stockList[i + 1].setPrice))
			{
				stockList[0].setPrice = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].stockClose, stockList[i + 1].stockClose))
			{
				stockList[0].stockClose = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].stockLast, stockList[i + 1].stockLast))
			{
				stockList[0].stockLast = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].isLimit, stockList[i + 1].isLimit))
			{
				stockList[0].isLimit = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].marginUnit, stockList[i + 1].marginUnit))
			{
				stockList[0].marginUnit = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].roundLot, stockList[i + 1].roundLot))
			{
				stockList[0].roundLot = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].inVal, stockList[i + 1].inVal))
			{
				stockList[0].inVal = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].timeVal, stockList[i + 1].timeVal))
			{
				stockList[0].timeVal = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].preInterest, stockList[i + 1].preInterest))
			{
				stockList[0].preInterest = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].openInterest, stockList[i + 1].openInterest))
			{
				stockList[0].openInterest = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].tradePhase, stockList[i + 1].tradePhase))
			{
				stockList[0].tradePhase = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].remainDate, stockList[i + 1].remainDate))
			{
				stockList[0].remainDate = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].leverage, stockList[i + 1].leverage))
			{
				stockList[0].leverage = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].premium, stockList[i + 1].premium))
			{
				stockList[0].premium = "@";
			}
		    
		    if(Util.hasDifference(stockList[i].orderRatio, stockList[i + 1].orderRatio))
			{
				stockList[0].orderRatio = "@";
			}
		}
		store.add(stockList);
	}
	

}
